function Switch(value) {
    if([true, false, "on", "off"].indexOf(value) === -1) throw new TypeError();
    const v = Boolean(value);
    v.__proto__.toString = function() { return this.valueOf() ? "on" : "off" };
    return v;
}

function Method(value) {
    const v = String(value);
    if(!["select", "poll", "kqueue", "epoll", "/dev/poll", "eventport"].includes(v))
        throw new Error("method invalid");
    return v;
}

module.exports = {
    Switch,
    Method
};